2 using System.Collections.Generic;
5 using Microsoft.Xna.Framework;
6 using Microsoft.Xna.Framework.Graphics;
8 namespace SuperPolarity
13 public int Multiplier;
22 public Player(SuperPolarity game)
28 DebugFont = Game.Content.Load<SpriteFont>("Fonts\\bigfont");
29 LifeSprite = Game.Content.Load<Texture2D>("Graphics\\neutral-ship");
32 public void AddScore(int value)
34 Score = Score + (value * Multiplier);
37 public void AddMultiplier(int value)
39 Multiplier = Multiplier + 1;
42 public void ResetMultiplier()
47 public void Draw(SpriteBatch spriteBatch)
49 var UiColor = new Color(0, 0, 0, 200);
50 var lightColor = new Color(0, 0, 0, 128);
51 spriteBatch.DrawString(DebugFont, Score.ToString(), new Vector2(10, 10), UiColor);
52 spriteBatch.DrawString(DebugFont, "x" + Multiplier.ToString(), new Vector2(10, 30), lightColor);
54 var lifePosition = new Vector2(Game.GraphicsDevice.Viewport.Width - 120, 10);
57 spriteBatch.Draw(LifeSprite, lifePosition, null, UiColor, (float)(Math.PI / 2), Vector2.Zero, 0.5f, SpriteEffects.None, 0f);
58 spriteBatch.DrawString(DebugFont, "x " + Lives.ToString(), new Vector2(lifePosition.X + 8, lifePosition.Y + 5), UiColor);
62 for (var i = 0; i < Lives; i++)
64 spriteBatch.Draw(LifeSprite, new Vector2(lifePosition.X + (i * 28), lifePosition.Y), null, UiColor, (float)(Math.PI / 2), Vector2.Zero, 0.5f, SpriteEffects.None, 0f);